package objects;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;

public class Ball{
	
	double xPos = 0;
	double yPos = 0;
	double xSpeed = 0;
	double ySpeed = 0;
	int radius = 0;
	Color ballColor = new Color(0, 0, 0);
	
	public Ball(double x, double y, double xSpeed, double ySpeed, int r, Color ballColor){
		xPos = x;
		yPos = y;
		this.xSpeed = xSpeed;
		this.ySpeed = ySpeed;
		radius = r;
		this.ballColor = ballColor;
	}
	
	public void move(Dimension windowSize){
		xPos += xSpeed;
		yPos += ySpeed;
	}
	
	
	public Graphics2D paint(Graphics2D g){
		g.setColor(ballColor);
		g.fillOval((int) xPos-radius, (int) yPos-radius, 2*radius, 2*radius);
		return g;
	}
	
	public Graphics2D clear(Graphics2D g, Color backgroundColor){
		g.setColor(backgroundColor);
		g.fillOval((int) xPos-radius, (int) yPos-radius, 2*radius, 2*radius);
		return g;
	}
	

	public double getxPos() {
		return xPos;
	}

	public void setxPos(double xPos) {
		this.xPos = xPos;
	}

	public double getyPos() {
		return yPos;
	}

	public void setyPos(double yPos) {
		this.yPos = yPos;
	}

	public double getxSpeed() {
		return xSpeed;
	}

	public void setxSpeed(double xSpeed) {
		this.xSpeed = xSpeed;
	}

	public double getySpeed() {
		return ySpeed;
	}

	public void setySpeed(double ySpeed) {
		this.ySpeed = ySpeed;
	}

	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}

	public Color getBallColor() {
		return ballColor;
	}

	public void setBallColor(Color ballColor) {
		this.ballColor = ballColor;
	}
	
	
}
